<%@ page import="com.alibaba.fastjson.JSON" %><%--
  Created by IntelliJ IDEA.
  User: dj
  Date: 2017/9/9
  Time: 13:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8" contentType="application/msexcel; charset=utf-8" isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<%
    response.setHeader("Content-disposition","attachment; filename=User.xls");

%>

<html>
<head>
    <title>Title</title>
    <meta http-equiv="Content-Type" content="application/msexcel;charset=utf-8"/><!-- 防止中文乱码 -->
    <meta http-equiv="pragma" content="no-cache"/>
    <meta http-equiv="cache-control" content="no-cache"/>
    <meta http-equiv="expires" content="0"/>
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"/>
    <meta http-equiv="description" content="This is my page"/>

</head>
<body>

  <table border="0px">
      <tr>
          <td>编码</td>
          <td>姓名</td>
          <td>性别</td>
          <td>年龄</td>
          <td>电话</td>
          <td>类型</td>

      </tr>


      <c:forEach var="row" items="${list}">
          <tr>
              <td><c:out value="${row.userCode}"></c:out> </td>
              <td><c:out value="${row.userName}"></c:out> </td>
              <td>
               <c:if test="${row.gender==1}">男</c:if>
                  <c:if test="${row.gender==2}">女</c:if>
              </td>
              <td><c:out value="${row.age}"></c:out> </td>
              <td><c:out value="${row.phone}"></c:out> </td>
              <td><c:out value="${row.role.name}"></c:out> </td>
          </tr>
      </c:forEach>



  </table>

</body>
</html>